# coding=UTF-8
'''
Created on 2018��4��23��

@author: lijie
'''
import unittest

class Verification(unittest.TestCase):

    def check_text_equal(self,str1,str2):
        self.assertEqual(str(str1), str(str2), str(str1)+" and "+str(str2)+" should equal,but not !!")
        
    def check_text_uneual(self,str1,str2):
        self.assertNotEqual(str(str1), str(str2), str(str1)+" and "+str(str2)+" should not equal,but equal !!")
        
    def check_dict_equal(self,d1,d2):
        self.assertDictEqual(d1, d2, str(d1)+" and "+str(d2)+" should equal,but not !!")      
    
    def check_dict_contain(self,subDict,d):
        self.assertDictContainsSubset(subDict, d, str(d)+" should contain "+str(subDict)+" ,but not !!")
        
    def check_if_none(self,obj):
        self.assertIsNone(obj, obj+" should is None, but not!!!")
        
    def check_if_not_none(self,obj,err_messg=" should not equal None, but equal!!!"):
        self.assertIsNotNone(obj, obj+err_messg)
        
    def check_true(self,exp,e="should was True, but False"):
        print("ERROR - "+e)
        self.assertTrue(exp,e)
        
    def check_size_more_zero(self,check_obj,e):
        if len(check_obj)<=0:
            print("ERROR - "+e)
            self.fail(e)
            
    def check_size_less_zero(self,check_obj,e):
        if len(check_obj)>0:
            print("ERROR - "+e)
            self.fail(e)
    
    def set_fail(self,msg):
        print("ERROR - "+msg)
        self.fail(msg)
        
        
        